<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 输入、处理、输出 
        // indexOf() 方法返回在数组中可以找到一个给定元素的第一个索引，如果不存在，则返回-1。
        let arr = ['jisoo', 'jennie', 'rose', 'lisa', 'blackpink'];
        // arr0 = [];
        /* for (var i = 0; i < arr.length-1; i++) {
            if (arr[i] != arr[0]) {
                arr0[arr0.length] = arr[i];
            }
        }
        console.log(arr0); */
        console.log(arr[1]);
        let arr0 = ['jennie'];
        for (let i = 0; i < arr.length -1; i++) {
            if (arr0[0] == arr[i]) {
            }
        }
        function indexOf(arr, ele) {
            var index = -1;
            if (!(arr instanceof Array)) {
                return -1;
            }
            for (var i = 0; i < arr.length; i++) {
                if (ele == arr[i]) {
                    index = i;
                    break;
                }
            }
            return index;
        }
        /*        
         for (var i = 0; i < arr.length; i++) {
            let index = -1 ;
                if (arr[i] == arr0[i]) {
                    arr0[arr0.length- 1] = arr[i];
                    index = i;
                }
                return index;
            } */



            if (arr[0]==arr[0]) {
                console.log(0);
            }
            else if (arr[0]==arr[1]) {
                console.log(1);
            }
            else if (arr[0]==arr[2]) {
                console.log(2);
            }
            else if (arr[0]==arr[3]) {
                console.log(3);
            }
            else if (arr[0]==arr[4]) {
                console.log(4);
            }
            else {
                console.log(-1);
            }
            for (let i = 0; i < arr.length; i++) {
                const element = arr[i];
                
            }


            
    </script>
</body>

</html>